package com.soecode.wxtools.bean;

import com.alibaba.fastjson.JSONObject;
import com.soecode.wxtools.bean.msgbuilder.*;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class WxMessage {

    private String toUser;
    private String toParty;
    private String toTag;
    private String agentId;
    private String msgType;
    private String content;
    private String mediaId;
    private String thumbMediaId;
    private String title;
    private String description;
    private String musicUrl;
    private String hqMusicUrl;
    private String safe;
    private List<WxArticle> articles = new ArrayList<WxArticle>();

    public String toJson() {
        return JSONObject.toJSONString(this);
    }

    @Data
    public static class WxArticle {

        private String title;
        private String description;
        private String url;
        private String picUrl;
    }

    public static TextBuilder TEXT() {
        return new TextBuilder();
    }

    public static ImageBuilder IMAGE() {
        return new ImageBuilder();
    }

    public static VoiceBuilder VOICE() {
        return new VoiceBuilder();
    }

    public static VideoBuilder VIDEO() {
        return new VideoBuilder();
    }

    public static NewsBuilder NEWS() {
        return new NewsBuilder();
    }

    public static FileBuilder FILE() {
        return new FileBuilder();
    }

}
